//1.引入路由
import {createRouter, createWebHashHistory} from "vue-router"

//2.定义routes
//引入页面组件

import toplist from "../pages/toplist"
import playlist from "../pages/playlist"

let routes = [
    {
        path: "/toplist",
        component: toplist
    },
    {
        path: '/playlist',
        component: playlist
    }
]

//3.创建路由实例
// vue3-router
export default createRouter({
    //定义路由模式
    //hash模式
    history: createWebHashHistory(),
    //VueRouter.createWebHistory() history模式
    routes
})

//vue2-router

// export default new VueRouter({
//     //路由模式
//     mode:'hash',
//     rotues
// })